#ifndef AST_STATEMENT_SECLECTION_STMT_H
#define AST_STATEMENT_SECLECTION_STMT_H

#include "../ASTNode.h"
class Expression;
class Statement;

/*
C99 6.8.4
selection-statement:
		if   (   expression   )   statement
		if   (   expression   )   statement   else   statement
		switch   (   expression   )   statement
*/
class SelectionStmt : public ASTNode
{
public:
	enum{
		if_stmt,
		else_stmt,
		switch_stmt,
	};
protected:
	SelectionStmt(void)
		: ASTNode(ASTNode::selection_statement){};
public:
	SelectionStmt(Expression *pExpr, Statement *pStmt1, Statement *pStmt2, int iType)
		: ASTNode(ASTNode::selection_statement)
		, m_pExpr(pExpr)
		, m_pStmt1(pStmt1)
		, m_pStmt2(pStmt2)
		, m_iType(iType){};

	virtual ~SelectionStmt(void);

	virtual void					codeGen();

protected:
	tiny_int						m_iType;
	Expression *					m_pExpr;
	Statement *						m_pStmt1;
	Statement *						m_pStmt2;
};


#endif

